/*
 * @Descripttion:
 * @version:
 * @Author: caiailing
 * @Date: 2023-03-29 14:42:43
 * @LastEditors:
 * @LastEditTime: 2023-04-04 17:30:56
 */
export default defineStore({
  id: 'test',
  persist: {
    // 开启持久化
    enabled: true,
    H5Storage: window?.localStorage,
    strategies: [
      {
        key: 'test',
        storage: window?.sessionStorage
      }
    ]
  },
  state: () => {
    return {
      name: '张三',
      token: 'token...'
    }
  },
  getters: {
    fullName: (state) => {
      return `${state.name}丰`
    }
  },
  actions: {
    updateName(name: any) {
      this.name = name
    }
  }
})
